<!DOCTYPE html>
<html class="x-admin-sm" xmlns:th="http://www.thymeleaf.org">
  
  <head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="../css/font.css">
    <link rel="stylesheet" href="../css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="../js/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" src="../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../js/xadmin.js"></script>
    <link rel="stylesheet" href="/static/lyCart/css/reset(1).css" th:href="@{/lyCart/css/reset(1).css}">
    <link rel="stylesheet" href="/static/lyCart/css/carts.css" th:href="@{/lyCart/css/carts.css}">
    <script src="/static/lyCart/js/carts.js" th:src="@{/lyCart/js/carts.js}"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <!--自定义css -->
  <style type="text/css">
    /*<!--所以td中的文字居中-->*/
    td {
      text-align: center;
    }
    .content b{
      padding: 60px;
    }
  </style>
  <body>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">演示</a>
        <a>
          <cite>导航元素</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">
      <div class="layui-row">
        <div>
          <button class="layui-btn" style="float: right"  onclick="backHome()"><i class="layui-icon layui-icon-return">&#xe65c;</i></button>
<!--        </div>-->
<!--        <div style="margin-top: 10px;">-->
<!--              <button class="layui-btn" style="height:30px;width: 60px;background-color: white" >-->
<!--                <i class="layui-icon" style="font-size: 20px;color: #7a45e5">&#xe615;</i>-->
<!--              </button>-->

          <div style="margin-top: 20px">
            <b style="font-size: 18px;">基本信息:</b>
          </div>
          <p>&nbsp;</p>
          <p>&nbsp;</p>
<!--        </div>-->
<div style="margin-left: 200px">
        <table class="layui-table" style="width: 1200px" th:each="orders:${orderList}">
          <thead>
          <tr style="background-color: cadetblue">
            <th style="text-align: center;font-weight: bold;font-size: 15px">订单编号</th>
            <th style="text-align: center;font-weight: bold;font-size: 15px">收货人</th>
            <th style="text-align: center;font-weight: bold;font-size: 15px">手机号码</th>
            <th style="text-align: center;font-weight: bold;font-size: 15px">邮政编码</th>
            <th style="text-align: center;font-weight: bold;font-size: 15px">邮寄方式</th>
          </tr>
          </thead>

          <tbody>
          <tr >
            <td th:text="${orders.orderCode}"></td>
            <td th:text="${orders.receiver}"></td>
            <td th:text="${orders.mobile}"></td>
            <td th:text="${orders.post}"></td>
            <td th:text="${orders.postMethod}"></td>
          </tr>
          </tbody>

          <thead>
          <tr style="background-color: cadetblue">
            <th style="text-align: center;font-weight: bold;font-size: 15px">物流单号</th>
            <th style="text-align: center;font-weight: bold;font-size: 15px">订单状态</th>
            <th style="text-align: center;font-weight: bold;font-size: 15px">订单类型</th>
            <th style="text-align: center;font-weight: bold;font-size: 15px">支付方式</th>
            <th style="text-align: center;font-weight: bold;font-size: 15px">收货地址</th>

          </tr>
          </thead>

          <tbody>
          <tr>
            <td>2017009171822298053</td>
            <td th:if="${orders.status=='1'}" >未付款</td>
            <td th:if="${orders.status=='2'}" >已付款</td>
            <td th:if="${orders.status=='3'}" >未发货</td>
            <td th:if="${orders.status=='4'}" >已发货</td>
            <td th:if="${orders.status=='5'}" >已完成</td>
            <td th:if="${orders.status=='6'}" >已取消</td>
            <td>正常订单</td>
            <td>支付宝</td>
            <td th:text="${orders.address}"></td>
          </tr>
          </tbody>

            <thead>
            <tr style="background-color: cadetblue">
                <th style="text-align: center;font-weight: bold;font-size: 15px">留言</th>
                <th style="text-align: center;font-weight: bold;font-size: 15px">下单时间</th>
                <th style="text-align: center;font-weight: bold;font-size: 15px">支付时间</th>
                <th style="text-align: center;font-weight: bold;font-size: 15px">邮寄时间</th>
                <th style="text-align: center;font-weight: bold;font-size: 15px">确认时间</th>

            </tr>
            </thead>

            <tbody>
            <tr>
                <td th:text="${orders.userMessage}"></td>
                <td th:text="${#dates.format(orders.createDate, 'yyyy-MM-dd HH:mm:ss')}" ></td>
                <td th:text="${#dates.format(orders.payDate, 'yyyy-MM-dd HH:mm:ss')}"></td>
                <td th:text="${#dates.format(orders.deliveryDate, 'yyyy-MM-dd HH:mm:ss')}"></td>
                <td th:text="${#dates.format(orders.confirmDate, 'yyyy-MM-dd HH:mm:ss')}"></td>
            </tr>
            </tbody>
        </table>
</div>
<!--          <form class="layui-form layui-col-md12 x-so">-->
<!--            <input class="layui-input" placeholder="开始日" name="start" id="start">-->
<!--            <input class="layui-input" placeholder="截止日" name="end" id="end">-->
<!--            <div class="layui-input-inline">-->
<!--              <select name="contrller">-->
<!--                <option>支付状态</option>-->
<!--                <option>已支付</option>-->
<!--                <option>未支付</option>-->
<!--              </select>-->
<!--            </div>-->
<!--            <div class="layui-input-inline">-->
<!--              <select name="contrller">-->
<!--                <option>支付方式</option>-->
<!--                <option>支付宝</option>-->
<!--                <option>微信</option>-->
<!--                <option>货到付款</option>-->
<!--              </select>-->
<!--            </div>-->
<!--            <div class="layui-input-inline">-->
<!--              <select name="contrller">-->
<!--                <option value="">订单状态</option>-->
<!--                <option value="0">待确认</option>-->
<!--                <option value="1">已确认</option>-->
<!--                <option value="2">已收货</option>-->
<!--                <option value="3">已取消</option>-->
<!--                <option value="4">已完成</option>-->
<!--                <option value="5">已作废</option>-->
<!--              </select>-->
<!--            </div>-->
<!--            <input type="text" name="username"  placeholder="请输入订单号" autocomplete="off" class="layui-input">-->
<!--            <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>-->
<!--          </form>-->

          <p>&nbsp;</p>
          <p>&nbsp;</p>
          <div style="margin-top: 20px">
            <b style="font-size: 18px;">商品信息:</b>
          </div>

            <form class="layui-form layui-col-md12 x-so" action="/order/orderDetail">
                <div class="layui-input-inline">
                    <input style="width: 300px"  type="text" name="inputName"   placeholder="请输入商品名查询" autocomplete="off" class="layui-input">
                    <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
                </div>
            </form>
      </div>
            <p>&nbsp;</p>
            <p>&nbsp;</p>



<!--        <section class="cartMain" style="border-color: red">-->
<!--          <div class="cartMain_hd">-->
<!--            <ul class="order_lists cartTop" >-->
<!--              <li class="list_chk">-->
<!--                &lt;!&ndash;所有商品全选&ndash;&gt;-->
<!--                <input type="checkbox" id="all" class="whole_check">-->
<!--                <label for="all"></label>-->
<!--                全选-->
<!--              </li>-->
<!--          <li class="list_con">商品名</li>-->
<!--          <li class="list_info">商品信息</li>-->
<!--          <li class="list_price">原价</li>-->
<!--          <li class="list_price">打折价</li>-->
<!--          <li class="list_amount">数量</li>-->
<!--          <li class="list_sum">金额</li>-->
<!--          <li class="list_op">操作</li>-->

<!--            </ul>-->
<!--          </div>-->
      <div style="margin-left: 100px">
          <table class="layui-table" style="width:1500px;border-collapse:separate;margin-right: 500px ">
            <thead>
          <div class="content" style="margin-left: 60px">
            <tr style="text-align: center">
            <th style="text-align: center;font-size: 15px;color: firebrick">商品名</th>
            <th style="text-align: center;font-size: 15px;color: firebrick">商品信息</th>
            <th style="text-align: center;font-size: 15px;color: firebrick">原价</th>
            <th style="text-align: center;font-size: 15px;color: firebrick">打折价</th>
            <th style="text-align: center;font-size: 15px;color: firebrick">数量</th>
            <th style="text-align: center;font-size: 15px;color: firebrick">金额</th>
            <th style="text-align: center;font-size: 15px;color: firebrick">操作</th>
            </tr>
          </div>
            </thead>

<!--          <p>&nbsp;</p>-->
            <tbody >
            <div class="cartBox">

              <div th:each="products:${productList}">
              <div class="order_content">
                <tr >
                    <td th:text="${products.id}" style="display: none"></td>
<!--                  <ul class="order_lists" >-->
<!--                    <li class="list_chk">-->
<!--                      <input type="checkbox" th:id="${products.id}+1" name="ddd" class="son_check" th:value="${products.id}">-->
<!--                      <label th:for="${products.id}+1"></label>-->
<!--                    </li>-->

<!--图片、产品名字-->
                    <td class="list_con" style="width: 300px" th:each="productImages:${products.productImages}">
                      <div class="list_img"><a href="javascript:;"><img  th:src="${productImages.url}" alt=""></a></div>
                      <div class="list_text"><a href="javascript:;" th:text="${products.name}"></a></div>
                    </td>
<!--产品别名-->
                    <td class="list_info" style="width: 300px">
                      <div class="list_text"><a href="javascript:;" th:text="${products.subTitle}"></a></div>
                    </td>
<!--原价-->
                    <td class="list_price">
                      <s class="price" th:text="'￥'+${products.originalPrice}" style="color: #009E94"></s>
                    </td>
<!--打折价-->
                    <td class="list_price">
                      <p class="price" th:text="'￥'+${products.promotePrice}"></p>
                    </td>
<!--                    <li class="list_amount">-->
<!--                      <div class="amount_box">-->
<!--                        <a href="javascript:;" class="reduce reSty">-</a>-->
<!--                        <input type="text" value="1" class="sum">-->
<!--                        <a href="javascript:;" class="plus">+</a>-->
<!--                      </div>-->
<!--                    </li>-->
<!--                    <li>-->

<!--                    </li>-->

<!--数量-->
                    <td class="list_sum" >
                      <p class="sum_price" th:text="${products.orderItem.number}"></p>
                    </td>
<!--金额-->
                    <td class="list_sum" >
                      <p class="sum_price" th:text="${products.promotePrice*products.orderItem.number}"></p>
                    </td>
<!--操作-->
                    <td class="list_op">
                        <p>    <a onclick="member_del(this)" style="color: #7a45e5">移除商品</a></p>
                    </td>
<!--                  </ul>-->
                </tr>
              </div>
<!--                <div style="float: right">-->
<!--                  <p>&nbsp;</p>-->
<!--                    <p class="price" th:text="'￥'+${products.promotePrice}"></p>-->
<!--                </div>-->

<!--                <p>&nbsp;</p>-->
<!--                <p>&nbsp;</p>-->
<!--                <p>&nbsp;</p>-->

              </div>
            </div>
            </tbody>
          </table>
          </div>

          <!--底部-->
          <div class="bar-wrapper" th:each="orders:${orderList}" style="margin-left: 200px">
            <div class="bar-right" style="margin-right: 220px">

                <div class="calBtn"><a href="javascript:;" onclick="total2()">总计</a></div>
<!--              <div class="piece">已选商品<strong class="piece_num">0</strong>件</div>-->
              <div class="totalMoney"> <strong class="total_text" id="total" th:text="${orders.total}"></strong></div>
            </div>
              <div class="bar-right" style="margin-right: 220px">

                <div class="calBtn"><a href="javascript:;" onclick="total2()">运费</a></div>
<!--              <div class="piece">已选商品<strong class="piece_num">0</strong>件</div>-->
              <div class="totalMoney"> <strong class="total_text" id="postage" th:text="${orders.postage}"></strong></div>
            </div>

          </div>

<!--        </section>-->
        <section class="model_bg"></section>
        <section class="my_model">
          <p class="title">删除宝贝<span class="closeModel">X</span></p>
          <p>您确认要删除该宝贝吗？</p>
          <div class="opBtn"><a href="javascript:;" class="dialog-sure">确定</a><a href="javascript:;" class="dialog-close">关闭</a></div>
        </section>

      </div>
    </div>
    <script>
      function backHome(){
        location.href ="/order/list"
      }



      layui.use('laydate', function(){
        var laydate = layui.laydate;
        
        //执行一个laydate实例
        laydate.render({
          elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
          elem: '#end' //指定元素
        });
      });

       /*用户-停用*/
      function member_stop(obj,id){
          layer.confirm('确认要停用吗？',function(index){

              if($(obj).attr('title')=='启用'){

                //发异步把用户状态进行更改
                $(obj).attr('title','停用')
                $(obj).find('i').html('&#xe62f;');

                $(obj).parents("tr").find(".td-status").find('span').addClass('layui-btn-disabled').html('已停用');
                layer.msg('已停用!',{icon: 5,time:1000});

              }else{
                $(obj).attr('title','启用')
                $(obj).find('i').html('&#xe601;');

                $(obj).parents("tr").find(".td-status").find('span').removeClass('layui-btn-disabled').html('已启用');
                layer.msg('已启用!',{icon: 5,time:1000});
              }
              
          });
      }

      /*订单-删除*/
      function member_del(obj, id) {
          var productId = $(obj).parents("tr").find("td").eq(0).text();
          layer.confirm('确认要移除吗？',
              function(index) {
                  $.ajax({
                      url:"/order/deleteOrderItemById",
                      async:false ,//异步
                      type:"get",
                      data:{productId:productId},
                      dataType:"json",
                      success:function(result){
                          if(result=="1"){
                              //发异步删除数据
                              $(obj).parents("tr").remove();
                              layer.msg('已取消!', {
                                  icon: 1,
                                  time: 1000
                              });
                          }else{
                              layer.msg('移除失败!', {
                                  icon: 2,
                                  time: 1000
                              });
                          }
                      },
                      error:function (result) {
                          // layer.msg("ajax请求失败",{icon:2,time:1000})
                          layer.msg("移除失败",{icon:2,time:1000})
                      }
                  })


              });
      }



      function delAll (argument) {

        var data = tableCheck.getData();
  
        layer.confirm('确认要删除吗？'+data,function(index){
            //捉到所有被选中的，发异步进行删除
            layer.msg('删除成功', {icon: 1});
            $(".layui-form-checked").not('.header').parents('tr').remove();
        });
      }

    </script>
    <script>var _hmt = _hmt || []; (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();</script>
  </body>

</html>